package jam.network.message;

import jam.network.NetworkController;
import java.util.Scanner;
import java.lang.String;

public class ResponseChannelList extends ServerResponse {

	public static void process(String msg) {
		Scanner s = new Scanner( msg );
		s.useDelimiter(":");

		//skip keyword
		s.next();
	 
		//get transID
		int id = s.nextInt();

		//clean up hashmap
		NetworkController.sent.remove(id);
	
		String result = s.next();

		if ( result.equalsIgnoreCase("TRUE") ) {
			System.out.println("Channel List: " );
			while (s.hasNext()) 
				System.out.println(s.next());
		}
		else
			System.out.println("Failed to get Channel List ");
	}

}